<template>
  <div class="baseChart" ref="baseChart">

  </div>
</template>

<script>
  var echarts = require('echarts')
  export default {
    data() {
      return {
        data: [
          { value: 1048, name: '广州' },
          { value: 735, name: '山东' },
          { value: 580, name: '上海' },
          { value: 484, name: '北京' },
          { value: 300, name: '河南' }
        ]
      }
    },
    methods: {
      baseChart() {
        var myChart = echarts.init(this.$refs.baseChart)
        myChart.setOption({
          xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
          },
          yAxis: {
            type: 'value'
          },
          series: [{
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar'
          }]
        })
      }
    },
    mounted() {
      this.baseChart()
    },
  }

</script>
<style lang='scss' scoped>
  .baseChart {
    width: 100%;
    height: 450px;
  }
</style>